<!--
 * @Author: atdow
 * @Date: 2021-07-21 09:49:12
 * @LastEditors: null
 * @LastEditTime: 2021-07-21 11:14:29
 * @Description: file description
-->
<template>
    <div class="apiNum-modal">
        <el-dialog title="接口列表" :visible.sync="dialogVisible">
            <el-table
                ref="tableRef"
                v-loading="loading"
                :data="tableList"
                border
            >
                <!-- <el-table-column type="index"></el-table-column> -->
                <el-table-column
                    type="index"
                    label="序号"
                    width="50"
                    align="center"
                />
                <el-table-column
                    label="服务中文名称"
                    prop="apiName"
                    align="center"
                    show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                    label="服务英文名称"
                    prop="apiNameEn"
                    align="center"
                    show-overflow-tooltip
                >
                    <!-- <template slot-scope="scope">
                        <p class="apiNameEn" @click="onApiNum(scope.row)">
                            {{ scope.row.apiNum || "-" }}
                        </p>
                    </template> -->
                </el-table-column>
                <el-table-column
                    label="接口所属组"
                    prop="groupName"
                    show-overflow-tooltip
                    align="center"
                >
                </el-table-column>
                <el-table-column
                    label="接口URL路径"
                    prop="requestPath"
                    align="center"
                    show-overflow-tooltip
                >
                    <template slot-scope="scope">
                        {{ scope.row.requestPath || "-" }}
                    </template>
                </el-table-column>
            </el-table>
            <span slot="footer" class="dialog-footer">
                <!-- <el-button @click="dialogVisible = false">取 消</el-button>
                <el-button type="primary" @click="submitForm" :loading="loading"
                    >确 定</el-button
                > -->
            </span>
        </el-dialog>
    </div>
</template>

<script>
import { getApiList } from "@/api/dataService/serviceMonitor/throttlingList";
export default {
    name: "apiNum-modal",
    props: {},
    data() {
        return {
            dialogVisible: false,
            loading: false,
            tableList: []
        };
    },
    components: {},
    watch: {},
    computed: {},
    created() {},
    mounted() {},
    methods: {
        submitForm() {},
        show(id) {
            this.loading = true;
            this.dialogVisible = true;
            getApiList({ limitingId: id })
                .then(res => {
                    if (res.code !== 200) {
                        return;
                    }
                    let { apiInfos = [] } = res.data || {};
                    !!!apiInfos && (apiInfos = []);
                    this.tableList = apiInfos;
                    //  console.log("apiInfos:", apiInfos);
                })
                .catch(err => {})
                .finally(() => {
                    this.loading = false;
                });
        }
    },
    beforeDestroy() {}
};
</script>

<style lang="scss" scoped></style>
